UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qdodNp+j0Xptb1x1melu7tlGQrCElxmnEznFmWby+b0='
WHERE
key_id = 'e3e7575836c83c0de2d8b47d1a5f1f20ca1755750af90ce2385ca9eae11bffaf'
AND (
token = 'qdodNp+j0Xptb1x1melu7tlGQrCElxmnEznFmWby+b0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)