UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SHIcArzwoedxGfL5738L8VV5NYK5+hXRgyW8eB/jJ6w='
WHERE
key_id = '4e2c8b390b99f811a304739ecc37b3010b1ca56174b948801f74004b321dccf9'
AND (
token = 'SHIcArzwoedxGfL5738L8VV5NYK5+hXRgyW8eB/jJ6w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)