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

Query time 0.00021