UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kxQffbzto9nrTEr6gKlSExLuEq1IqJvKgjPWrkWyhjs='
WHERE
key_id = '3d11d23e79e186e582ebf3c2506fe50d953ac5ee94d10847df2674c456cca36a'
AND (
token = 'kxQffbzto9nrTEr6gKlSExLuEq1IqJvKgjPWrkWyhjs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)