UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XVKRXY/t5ttrXao+kED0AhPPlccvmmSJ4cb+1gK829Q=' 
WHERE 
  key_id = 'c25e14bd5f079a5fdf6952ac477e4cf424c3ffaab6553ec6e24a3f7cb9f17cde' 
  AND (
    token = 'XVKRXY/t5ttrXao+kED0AhPPlccvmmSJ4cb+1gK829Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037