UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IXgxQkL4032tMkCyW16Vrik2Foruzp/8wzM81VuwU64=' 
WHERE 
  key_id = '3e373f00d81d29e762c0a3ce31d3d3d07ad6700f56526df5838183eca9abddc7' 
  AND (
    token = 'IXgxQkL4032tMkCyW16Vrik2Foruzp/8wzM81VuwU64=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040