UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '14daFWI4WahtOXPGVE5nLgXY9r6B6DqupO/g7axVP7c=' 
WHERE 
  key_id = 'a5c74db4fa3d3f94da39a8071368a234ae669f9cccc39700612be10941703cb1' 
  AND (
    token = '14daFWI4WahtOXPGVE5nLgXY9r6B6DqupO/g7axVP7c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034