UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BADLjq6H6dpFpSUEJRSoStpB4Kk69aQe8x52fMZfjCI='
WHERE
key_id = '054d7b00d50e7cbe25aa92f53b45c5c205bbfbe1b546288842a71be71ea871e5'
AND (
token = 'BADLjq6H6dpFpSUEJRSoStpB4Kk69aQe8x52fMZfjCI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)