UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UZ6vxH/DNvsbfc/LEcwHF310rU5LC8vSytaqQ/G8/dk=' 
WHERE 
  key_id = '553a3a8c16736fe8929eb4fa1217496d1e7c8b2d95d6e7c21b3745298c3f3edb' 
  AND (
    token = 'UZ6vxH/DNvsbfc/LEcwHF310rU5LC8vSytaqQ/G8/dk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019