UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '612jxMAB7ogH0qPg1OjW+LWIiHWzIncjfo+X3Lm+8PE='
WHERE
key_id = 'cf4a4d5855064f157a4552f94158748c89ba0995439cfdad9e40dddc68ac734f'
AND (
token = '612jxMAB7ogH0qPg1OjW+LWIiHWzIncjfo+X3Lm+8PE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)