UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dE89EGOcX0ExuHdCOCvqPOiTHsR0Co/H17IM2TUwb1w=' 
WHERE 
  key_id = '508efdd44102626ddd236091fae8ba8c0caf7dbfcc7bdb856a1300ccf0b7b0cc' 
  AND (
    token = 'dE89EGOcX0ExuHdCOCvqPOiTHsR0Co/H17IM2TUwb1w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020