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

Query time 0.00023