UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Yqs+mBZmkkQi6nugm0mOXxom6Cdvv63hOMewsE5stjw='
WHERE
key_id = '7dd2d1eec143cb22f8e917fabbfceb92d383007ee11ef95751ef26851b8d46fe'
AND (
token = 'Yqs+mBZmkkQi6nugm0mOXxom6Cdvv63hOMewsE5stjw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)