UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bmKqEzDbUOlMtBfhWHnBzmZnyRAxtwCRru6bxi/eMXE='
WHERE
key_id = 'd5387f84e822d37b7f44622c895a657699909d8fe29d457b5fd87509c6fd4bfb'
AND (
token = 'bmKqEzDbUOlMtBfhWHnBzmZnyRAxtwCRru6bxi/eMXE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)