UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YBwcRwEQU9XwZtEiFBc4K5UggNvfZVS90nmO9grasdc=' 
WHERE 
  key_id = 'f27d41528d7a1f36b75b261c4834bd77652cce54f995d3e2dfe6361c8ab3ce56' 
  AND (
    token = 'YBwcRwEQU9XwZtEiFBc4K5UggNvfZVS90nmO9grasdc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021