UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0+90UB3dqlCFMgQBDLlYeowTE5VKig5xrZ1lwcHqlXk='
WHERE
key_id = '0ad7daf21b06dae8ad1214e631890bfab9dd09decb744620f43bc98827d92e50'
AND (
token = '0+90UB3dqlCFMgQBDLlYeowTE5VKig5xrZ1lwcHqlXk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)