UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FfQ5r9HVPrBkbO5o3eq+jh7gy9gjitDn14BEZba52qk='
WHERE
key_id = '8428ab2f4beee94ddc4e58a712b77dd3e43abad093e330bcdc7130de11dbd5f4'
AND (
token = 'FfQ5r9HVPrBkbO5o3eq+jh7gy9gjitDn14BEZba52qk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)