UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ftoxh0oabZQ8f8iHt9rBQ9zrx+vjGiQcO7XdPkBL/J8=' 
WHERE 
  key_id = '4914d3874693f39d6910e40c4887c178b1c5fb0f8f4693c9414f22335e1018c0' 
  AND (
    token = 'ftoxh0oabZQ8f8iHt9rBQ9zrx+vjGiQcO7XdPkBL/J8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029