UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JpfNpNYX2ErR3q/71qgCcSTnU1BvR1qRBv0i/KyjhsE='
WHERE
key_id = '21673b12d4299fe7130de4c90622606c7aa83483bc7a4e45a16b0f03b0047af5'
AND (
token = 'JpfNpNYX2ErR3q/71qgCcSTnU1BvR1qRBv0i/KyjhsE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)