UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '98DPxmCpyMLGOiOlXBKyS/GqnRtnpuElo3y8JocgP3A='
WHERE
key_id = '782a4bd8842878f60c24e19b925e38d27a8b1942e1dbfb7c9565fb11571d7da2'
AND (
token = '98DPxmCpyMLGOiOlXBKyS/GqnRtnpuElo3y8JocgP3A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)