UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CYoJfek/u0mB52YNYfZAJNYnmfE3zCLuvCN/YhKHtI8='
WHERE
key_id = '14a155a7c971846872ed53c7e1eaad6ecb2eaeb34870fd61335a6aaf140632f7'
AND (
token = 'CYoJfek/u0mB52YNYfZAJNYnmfE3zCLuvCN/YhKHtI8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)