UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DAFYKMobr9InDPu2easJ5dspIhSvRu67OnjbGvsjpm8='
WHERE
key_id = '1f367f249bc12deb52df2146ab73c596bd05fc5d1e8b16dfbd71af542c199b60'
AND (
token = 'DAFYKMobr9InDPu2easJ5dspIhSvRu67OnjbGvsjpm8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)