UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'f7039PZDAJHkT8FErhOjCS/37icrMaCPihVubJ1aM68='
WHERE
key_id = '4aaf1e7155dbd850b001c0cca7083d6a5ad98d8142d0b09fbe64c27f52ba34f6'
AND (
token = 'f7039PZDAJHkT8FErhOjCS/37icrMaCPihVubJ1aM68='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)