UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AMoDcRbhOQT/mwZxbGGb/QsS+ePOM6AtcmBt0U6jfVo='
WHERE
key_id = '6a34c2341af56389b1ec8b3fe93a9d21caa5deb5ece022face6260d7dbe2dc99'
AND (
token = 'AMoDcRbhOQT/mwZxbGGb/QsS+ePOM6AtcmBt0U6jfVo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)