UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tBNIk/LiYfxcxENyqM99IYDmDYsC+u08PAKeNdcrctE='
WHERE
key_id = '7e36d37628b1886ce914b59e5162710d190d326b23b908098c7f04466e892d84'
AND (
token = 'tBNIk/LiYfxcxENyqM99IYDmDYsC+u08PAKeNdcrctE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)