UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'W8zskrftv8gWCHoKFPCN/vIuTUcKcfwdvLe0/9X8C48=' 
WHERE 
  key_id = '9e630d8abd730326447a22f37e9e4f74b2a18608146074614bcc112280b203d1' 
  AND (
    token = 'W8zskrftv8gWCHoKFPCN/vIuTUcKcfwdvLe0/9X8C48=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016