UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G9pPCJuNX5rheOOtuIHHyZ5Rk1tXdiOVG0+FCboL//I='
WHERE
key_id = '51ac0d10e664d3fde8cb70fa6e4f6e2d444f89888f66a3916ba91569d9d75ecb'
AND (
token = 'G9pPCJuNX5rheOOtuIHHyZ5Rk1tXdiOVG0+FCboL//I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)