UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'h7HHrZcYGnjXnF+mM07Mg+H5jkyJGhQj/j0d8575NNo='
WHERE
key_id = 'e20cd7c4fcbf5229b3a3f1e7f2594cecacbc625280906921b4401d73ccdc82e3'
AND (
token = 'h7HHrZcYGnjXnF+mM07Mg+H5jkyJGhQj/j0d8575NNo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)