UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Tzq9f3iAc0RMPgdovpcpS1CBZJVnUtnXwoqHqJV22UU='
WHERE
key_id = 'e2c453113382b98d05c0899f91461bc1ec839ed8d718c6d027aed62daacab0f1'
AND (
token = 'Tzq9f3iAc0RMPgdovpcpS1CBZJVnUtnXwoqHqJV22UU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)