UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HmlyVSlrLYjgYvpCzZH4as11oZhLb70gu1gZOMwa8vE='
WHERE
key_id = 'a4aa1163fbf46e86d0e99ae81f2d62a9c0bcad3b85ae741ba2b9d0ed64867ab1'
AND (
token = 'HmlyVSlrLYjgYvpCzZH4as11oZhLb70gu1gZOMwa8vE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)