UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Fs/knUxLLx3TO/qtpMHZpkIU0PFEvUJSbzijUBeIfqU=' 
WHERE 
  key_id = 'cab6a676bab70a174323aa78c0a382748b15715a3f8a0c8b63d88b6848f8dc80' 
  AND (
    token = 'Fs/knUxLLx3TO/qtpMHZpkIU0PFEvUJSbzijUBeIfqU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036