UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'np9dJuczXmkISrE9PK/NDGfK5igqLFZ/I9N8/zN4DDo='
WHERE
key_id = '660615276d51a70d443c4b979c8d6b947473573f5618f76704372d9a4372aad9'
AND (
token = 'np9dJuczXmkISrE9PK/NDGfK5igqLFZ/I9N8/zN4DDo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)