UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '85wlVuCQt6idIamTTbFpw1eTOx78pObMULy7z0+RCwA=' 
WHERE 
  key_id = 'c8dd0833e4e2c8d03d58390e3870fcfca1640e0f4e1662a12ef1f6cb805e998c' 
  AND (
    token = '85wlVuCQt6idIamTTbFpw1eTOx78pObMULy7z0+RCwA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018