UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YcvOziwPkIkNMJN56Jtr6bZrfN+Xo9gPQxJYTwDGCLg=' 
WHERE 
  key_id = '0276415bd9083447dd4882d839b9124ee5a091bb597e7e5fdb24b113eeed35d3' 
  AND (
    token = 'YcvOziwPkIkNMJN56Jtr6bZrfN+Xo9gPQxJYTwDGCLg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00063