UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hBqU2BpGqEjaFfTRom4Z4SDvZbsnZvQAg1QGM3p3B1I='
WHERE
key_id = '3ead5b0f942fcdedc19731cc723b2374f17b4183763a9db9c2d307ff0f815312'
AND (
token = 'hBqU2BpGqEjaFfTRom4Z4SDvZbsnZvQAg1QGM3p3B1I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)