UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tbBq3m6+V/LMpgfPDxDEfqyvwQEJfdaj7aeWqiwWKIQ=' 
WHERE 
  key_id = '86aa7832fdad7bd5b5a0217ac3de7b7bbfb8237962292d604096ed89b550428f' 
  AND (
    token = 'tbBq3m6+V/LMpgfPDxDEfqyvwQEJfdaj7aeWqiwWKIQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032