UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yL3I/w5L76BiscyDgl6LjfRVvfx7z0h45w6bWwx5ZPs=' 
WHERE 
  key_id = '5ac4ccca63ae35c0c99404f9c4ba45e1b38483c80b0bcc3ed2ebebc5e735ae28' 
  AND (
    token = 'yL3I/w5L76BiscyDgl6LjfRVvfx7z0h45w6bWwx5ZPs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054