UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7sxx+O84M+/m4VjXk9aPDeU56eUN4VWyXGEvzmd8beI='
WHERE
key_id = 'a8ac76041b2f4c22067a627c93eab5cbddef2319bacac69daf19bdcb205c9e93'
AND (
token = '7sxx+O84M+/m4VjXk9aPDeU56eUN4VWyXGEvzmd8beI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)