UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M6bOGypBjrKHiBHbzslDc7/NGDMvodTbIipn8CxP10I='
WHERE
key_id = '5e9b796075c21c00d5e5ba34148b3681d110efa6e320aec632aafeb6e5dc933e'
AND (
token = 'M6bOGypBjrKHiBHbzslDc7/NGDMvodTbIipn8CxP10I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)