UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Vqh0CI5s/9JjqFhb73RJUjNwYbMp2edsa+b1yxI0ehw=' 
WHERE 
  key_id = '94515ed7508fa94e00d5760cd6c1ec3c2bdbdf58d8ae84df14c1bbd4396573a7' 
  AND (
    token = 'Vqh0CI5s/9JjqFhb73RJUjNwYbMp2edsa+b1yxI0ehw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043