UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pHcKaRmykPF0D/AeLiAeiUbYKF0N2pDBBxaacpTpTpE='
WHERE
key_id = '7a4a5896d065e593a4417641c4b7069ee5204b05db203782ccb2102f23c47ddb'
AND (
token = 'pHcKaRmykPF0D/AeLiAeiUbYKF0N2pDBBxaacpTpTpE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)