UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zY3yzJ4fMLtda/fmKXQY8gUDhovbggz4+CVA6jvmN+g=' 
WHERE 
  key_id = '44b913ba177498b211d19338614b2406d70d68fae510f5bb3134ffb05bc0e138' 
  AND (
    token = 'zY3yzJ4fMLtda/fmKXQY8gUDhovbggz4+CVA6jvmN+g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034