UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6FI3tCsjDELiRSZhgFTs6JO4Dc5//+sb4wswx2NJRE0='
WHERE
key_id = 'ad703ee9c0c3a1b99699e1456fc50717dbd8a48d01722227f1dd2f9e56916a5f'
AND (
token = '6FI3tCsjDELiRSZhgFTs6JO4Dc5//+sb4wswx2NJRE0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)