UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KUUpmRdv68M5OGmX9IlPHPhyTv6LWKrHW/lSlo6gwvg='
WHERE
key_id = 'ad48643e9490f294c2fe256f8d780aa7a850a9c87c1269c8b8f23553c335c179'
AND (
token = 'KUUpmRdv68M5OGmX9IlPHPhyTv6LWKrHW/lSlo6gwvg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)