UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TpTthw58Sz7Z3ai5nogKMPN8ZwpEoCAzLkmbCVp0JP8='
WHERE
key_id = '5b12746e93f0c8931ac868d26854ed4f58819e1cdc3bc293a0d6283a34eb45ab'
AND (
token = 'TpTthw58Sz7Z3ai5nogKMPN8ZwpEoCAzLkmbCVp0JP8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)