UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rBJ6X7k+rIMVQ17N6AzWb0e6yMR/eF8VHPnBC1zQ6Ws='
WHERE
key_id = 'ca4d3af47e4acbbe44ba81ac62c7dd9b589d8b0403be028fdde5ce786446bd83'
AND (
token = 'rBJ6X7k+rIMVQ17N6AzWb0e6yMR/eF8VHPnBC1zQ6Ws='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)