UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'E/4kNwzqNStZnbxM4IDxPEASzTKEXkllplFcaApm0cs=' 
WHERE 
  key_id = 'a95cc52dd6854ed3e1c17bf0f1803ecedc25c3d0c8ca79f4178ff18cb112384f' 
  AND (
    token = 'E/4kNwzqNStZnbxM4IDxPEASzTKEXkllplFcaApm0cs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025