UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K+hvP3D89OLNKxTjTMg/VPObqAik6u8Zvgf4Fm10cEs='
WHERE
key_id = '694eb8d3fc17d7c870de095abf2c2cff394a8898aa377f31f34349759ba29469'
AND (
token = 'K+hvP3D89OLNKxTjTMg/VPObqAik6u8Zvgf4Fm10cEs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)