UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DJK/lcgnhSsXZRfOoY3aokGhWe+tlZcZt7zdLWkJk9w=' 
WHERE 
  key_id = 'b2c378d90f9d18874112eee5f3e7f0d0d8062dd6bb38b399da57ffea530aa500' 
  AND (
    token = 'DJK/lcgnhSsXZRfOoY3aokGhWe+tlZcZt7zdLWkJk9w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043