UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '17WPOcvUx4NHRKJ/igO66caOP2PP/rK93JJ4ib6UOd4=' 
WHERE 
  key_id = '78d53a8c6bf6aea8ffd8da28e6e6a0f2373b57e6120b38272947f73ed2fe7091' 
  AND (
    token = '17WPOcvUx4NHRKJ/igO66caOP2PP/rK93JJ4ib6UOd4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031