UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1/UechlNeaUDvFmlkoRIaLlTKi8ZxA25wvjaOzKQz8o='
WHERE
key_id = '12dc002684355ac666d0ae443db28e7edec741ef525b6939c840ca99ae751147'
AND (
token = '1/UechlNeaUDvFmlkoRIaLlTKi8ZxA25wvjaOzKQz8o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)