UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cqfvBK5jl/CzyY6cVvXG64cHZSLC0aKeb4DfFPKkAog='
WHERE
key_id = 'fcca365dd3a6f78e20a7666d3f7f031e22d6610603462233a54d483ee4b38991'
AND (
token = 'cqfvBK5jl/CzyY6cVvXG64cHZSLC0aKeb4DfFPKkAog='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)