UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yy392asJrgmAwhBPVujNHh09i+vakhgcY/SZ7BplzVU='
WHERE
key_id = 'fed67be1ab3f8a7a4964529dfbe7e7ccd3b7f2521f549df080dedd1fec3b6f33'
AND (
token = 'yy392asJrgmAwhBPVujNHh09i+vakhgcY/SZ7BplzVU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)