UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DQthOjwx5d+0u1g8xA1p7m12cEPcELpG/d8zPtBX+gY=' 
WHERE 
  key_id = 'c21b2642ca6702715a8503dd84a2dc682fa62fac6e9a907c827611329eb4685e' 
  AND (
    token = 'DQthOjwx5d+0u1g8xA1p7m12cEPcELpG/d8zPtBX+gY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033