UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '992Rj6SRZnXeePexjhxK+WDPPGzO6UOOrxzSNGRPwSQ='
WHERE
key_id = 'bc92a902c6ca19b1445e65490bcccbbd28b89c3d95d8a1095f089811ac0f8490'
AND (
token = '992Rj6SRZnXeePexjhxK+WDPPGzO6UOOrxzSNGRPwSQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)