UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6OIpfEDsoc7cZikmkWkXLrTpgK2hxoVaSAdNtuXDvaU='
WHERE
key_id = '90ab0af770566de476b10e4d6f0400d9c746f129d42745ec819bcc5b8e39b190'
AND (
token = '6OIpfEDsoc7cZikmkWkXLrTpgK2hxoVaSAdNtuXDvaU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)