UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 't+hZpTs3QuDFvnNCL8JXKU1bqfWgMQE++FveQYtFoAM=' 
WHERE 
  key_id = '3bed63c0bfc1b969c1bd2bd79fa388eaa40e7831f46f2cd953cdaacaa21ee4f3' 
  AND (
    token = 't+hZpTs3QuDFvnNCL8JXKU1bqfWgMQE++FveQYtFoAM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00065