UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wLiwRrgdrxy6PjuTvO2qTrxbJ9r24E9GkMbJXi8VVHE=' 
WHERE 
  key_id = 'faaaccf0bd06b476e9e56aab3d8920e2f21317a3fd8f5f12d68724f4c0be5831' 
  AND (
    token = 'wLiwRrgdrxy6PjuTvO2qTrxbJ9r24E9GkMbJXi8VVHE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045