UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'm1cpVBr4Ynxi9v5VjHsD4ZNb4x1UiTnfQ23lS/V3szc=' 
WHERE 
  key_id = '749cbdb8c8e53b4c29b00c86ef65897ecbee9568c1662224ff74ff36440ceada' 
  AND (
    token = 'm1cpVBr4Ynxi9v5VjHsD4ZNb4x1UiTnfQ23lS/V3szc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020