UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DShbPhwnQtMY0vk0Vu9Gf0Wwtu+cgSa4ddIT6GiMX2A=' 
WHERE 
  key_id = '4f4841d2ee259a860ed6e25d96a5f393d04690b20e927dba40b65aa5eb129a4d' 
  AND (
    token = 'DShbPhwnQtMY0vk0Vu9Gf0Wwtu+cgSa4ddIT6GiMX2A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00013